var a = getApp();

Page({
    data: {
        images: [],
        titles: [],
        isLogin: !1,
        role: 0,
        needClose: !1
    },
    clickClose: function(e) {
        wx.showTabBar({}), wx.switchTab({
            url: a.globalData.currentTab
        });
    },
    clickItem: function(e) {
        var t = e.currentTarget.dataset.index;
        1 == wx.getStorageSync(a.storage.role) && (t += 1), 0 == t ? wx.navigateTo({
            url: "../schedule/scheduleType/scheduleType"
        }) : 1 == t ? wx.navigateTo({
            url: "addVideo/addVideo"
        }) : 2 == t ? wx.navigateTo({
            url: "addImage/addImage"
        }) : 3 == t ? wx.navigateTo({
            url: "addTuwen/addTuwen"
        }) : 4 == t && wx.navigateTo({
            url: "addOrder/addOrder"
        });
    },
    setUpData: function() {
        var e = wx.getStorageSync(a.storage.role), t = [ "/images/add/ic_add_schedule.png", "/images/add/ic_add_video.png", "/images/add/ic_add_image.png", "/images/add/ic_add_teletext.png", "/images/add/ic_add_sendorder.png" ], d = [ "档期", "视频/作品", "图片", "图文", "查档" ];
        1 == (e = e || 0) ? (d = [ "视频/作品", "图片", "图文", "查档" ], t = [ "/images/add/ic_add_video.png", "/images/add/ic_add_image.png", "/images/add/ic_add_teletext.png", "/images/add/ic_add_sendorder.png" ]) : d = 4 == e ? [ "档期", "视频/作品", "图片", "图文", "查档" ] : 3 == e || 5 == e ? [ "档期", "视频", "图片", "图文/作品", "查档" ] : [ "档期", "视频/作品", "图片", "图文/作品", "查档" ], 
        this.setData({
            images: t,
            titles: d
        });
    },
    onLoad: function(e) {
        1 == e.success ? (wx.showTabBar({}), wx.switchTab({
            url: a.globalData.currentTab
        })) : this.setUpData();
    },
    onReady: function() {},
    onShow: function() {
        this.data.needClose && (wx.showTabBar({}), wx.switchTab({
            url: a.globalData.currentTab
        }), this.setData({
            needClose: !1
        })), a.util.isLogin() ? (this.setData({
            isLogin: !0
        }), this.setUpData()) : this.setData({
            isLogin: !1
        }), wx.hideTabBar({});
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {
        var e = a.util.getShareInfo();
        return {
            title: a.globalData.commonShareTitle,
            path: e[0],
            imageUrl: e[1],
            success: function(a) {},
            fail: function(a) {}
        };
    }
});